'use strict';

function choose_common_elements(collection_a, collection_b) {
  var ai=0, bi=0;
  var arr = [];
  for(ai=0;ai<collection_a.length;ai++){
   for(bi=0;bi< collection_b.length;bi++){ //while( ai < collection_a.length && bi < collection_b.length )
                 if(collection_a[ai]==collection_b[bi]){
                   arr.push(collection_a[ai]);             
       }
     }//
  }
  return arr;
 
  //在这里写入代码
}

module.exports = choose_common_elements;
